/*
 * lib2Desa - Another 2D game library in C++
 * Copyright (C) 2009 Erivaldo Xavier de Lima Filho
 *
 * This program is free software and is distributed under GNU General Public License version 3. You can modify and/or redistribute
 * it under the terms of GPL version 3 or posterior version. This program comes with NO WARRANTY, for more details, see LICENSE,
 * or <http://www.gnu.org/licenses>.
 *
 * Contact info:
 *
 *	Erivaldo Xavier de Lima Filho, desadoc@gmail.com
 *
 */

#ifndef _IEVENT_HPP
#define _IEVENT_HPP

#include "Core/shared_ptr.hpp"

#ifndef _NO_NAMESPACE
namespace lib2Desa {
#endif

class GameObject;

class IEvent
{

private:

	bool consumed;

protected:

	IEvent(void)
	: consumed(false)
	{

	}

public:

	virtual ~IEvent(void){}

	enum EVENT_TYPE
	{
		ET_NONE,
		ET_WINDOW,
		ET_KEY,
		ET_COLLISION,
	};

	virtual EVENT_TYPE getType(void) const = 0;

	void consume(void)
	{
		consumed = true;
	}

	bool isConsumed(void)
	{
		return consumed;
	}

	virtual const weak_ptr<GameObject>& getSource(void) const = 0;
	virtual const weak_ptr<GameObject>& getTarget(void) const = 0;
};

#ifndef _NO_NAMESPACE
}
#endif

#endif /*IEvent.hpp included*/
